package com.ruoyi.attendance.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.attendance.mapper.HrAttendanceRecordMapper;
import com.ruoyi.attendance.domain.HrAttendanceRecord;
import com.ruoyi.attendance.service.IHrAttendanceRecordService;

/**
 * 打卡记录Service业务层处理
 * 
 * @author gy
 * @date 2025-05-20
 */
@Service
public class HrAttendanceRecordServiceImpl implements IHrAttendanceRecordService 
{
    @Autowired
    private HrAttendanceRecordMapper hrAttendanceRecordMapper;

    /**
     * 查询打卡记录
     * 
     * @param id 打卡记录主键
     * @return 打卡记录
     */
    @Override
    public HrAttendanceRecord selectHrAttendanceRecordById(Long id)
    {
        return hrAttendanceRecordMapper.selectHrAttendanceRecordById(id);
    }

    /**
     * 查询打卡记录列表
     * 
     * @param hrAttendanceRecord 打卡记录
     * @return 打卡记录
     */
    @Override
    public List<HrAttendanceRecord> selectHrAttendanceRecordList(HrAttendanceRecord hrAttendanceRecord)
    {
        return hrAttendanceRecordMapper.selectHrAttendanceRecordList(hrAttendanceRecord);
    }

    /**
     * 新增打卡记录
     * 
     * @param hrAttendanceRecord 打卡记录
     * @return 结果
     */
    @Override
    public int insertHrAttendanceRecord(HrAttendanceRecord hrAttendanceRecord)
    {
        return hrAttendanceRecordMapper.insertHrAttendanceRecord(hrAttendanceRecord);
    }

    /**
     * 修改打卡记录
     * 
     * @param hrAttendanceRecord 打卡记录
     * @return 结果
     */
    @Override
    public int updateHrAttendanceRecord(HrAttendanceRecord hrAttendanceRecord)
    {
        hrAttendanceRecord.setUpdateTime(DateUtils.getNowDate());
        return hrAttendanceRecordMapper.updateHrAttendanceRecord(hrAttendanceRecord);
    }

    /**
     * 批量删除打卡记录
     * 
     * @param ids 需要删除的打卡记录主键
     * @return 结果
     */
    @Override
    public int deleteHrAttendanceRecordByIds(Long[] ids)
    {
        return hrAttendanceRecordMapper.deleteHrAttendanceRecordByIds(ids);
    }

    /**
     * 删除打卡记录信息
     * 
     * @param id 打卡记录主键
     * @return 结果
     */
    @Override
    public int deleteHrAttendanceRecordById(Long id)
    {
        return hrAttendanceRecordMapper.deleteHrAttendanceRecordById(id);
    }
}
